<template>
  <div>
    <p>跳转中....</p>
  </div>
</template>
<script>
import { oauth_callback_post } from './axios_api/api'
export default {
  mounted() {
  },
  methods: {
    getCode() {
      let code = this.$route.query.code
      let params = { code: code }
      oauth_callback_post(params).then((resp) => {
        console.log(resp)
        if (resp.data.type == '0') {
          let res = resp.data
          localStorage.setItem('username', res.username)
          localStorage.setItem('token', res.token)
          localStorage.setItem('uid', res.id)
          this.login_username = res.username
          this.opened = false
          this.$router.push('/')

        }
        if (resp.data.type == '1') {
          this.visiable = true
          this.uid = resp.data.uid
        }
      })
    },
  }
}
</script>
